package cn.youwan.market;




import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import cn.youwan.market.welcome.AppViewPager;
import cn.youwan.market.welcome.AppViewPager.OnAppPageChangeListener;

public class WelcomeActivity extends Activity implements OnAppPageChangeListener{

	private AppViewPager av;
	private View v;
	/**
	 * 首次打开欢迎界面
	 */
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        
        av=(AppViewPager) findViewById(R.id.viewpager);
		av.setHorizontalScrollBarEnabled(false);
		v=LayoutInflater.from(this).inflate(R.layout.layout1, null);
		View v2=LayoutInflater.from(this).inflate(R.layout.layout2, null);
		View v3=LayoutInflater.from(this).inflate(R.layout.layout3, null);
		View v4=LayoutInflater.from(this).inflate(R.layout.layout4, null);
		av.addView(v);
		av.addView(v2);
		av.addView(v3);
		av.addView(v4);
		v4.findViewById(R.id.btn_enter).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				WelcomeActivity.this.finish();
				Intent intent=new Intent(WelcomeActivity.this,DrawerActivity.class);
				startActivity(intent);
				overridePendingTransition(R.anim.right_in,R.anim.left_out);
			}
		});
		av.setOnAppPageChangeListener(this);
    }

	@Override
	public void onAppPageSelected(int position) {
	}

}
